import pytest
from api.py01_login_api import Ihrm_Login_Api
from common.assert_tools import assert_tools
from common.read_json import read_data
from config import BASE_DIR


class Test_Message_login(object):
    login = read_data(BASE_DIR + '/data/login.json')

    @pytest.mark.parametrize('desc,login,status_code,code,success,message', login)
    def test_login(self, desc, login, status_code, code, success, message):
        resp = Ihrm_Login_Api.login_api(login)
        assert_tools(resp,status_code,code,success,message)
